﻿<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="org.jxstar.util.config.SystemVar,
				 com.hatic.login.PmLoginUtil" %>
<%
	String contextpath = request.getContextPath();
	String curLangType = "zh";//java.util.Locale.getDefault().getLanguage();
	String supLangType = org.jxstar.util.config.SystemVar.getValue("sys.lang.type");
	
	String svnNum = SystemVar.getValue("index.svn", "40");
	String indexType = SystemVar.getValue("index.type", "1");
	String indexName = SystemVar.getValue("index.name", "JXstar软件开发平台");
	String indexBottom = SystemVar.getValue("index.bottom", "");
	
	String verNo = SystemVar.getValue("sys.version.no", "V1.0.0.0");
	String verType = SystemVar.getValue("sys.version.type", "");
	String useCase = SystemVar.getValue("page.query.case", "0");
	
	String loginCss = "resources/css/login.css?verno=" + svnNum;
	if (indexType.equals("1")) loginCss = "resources/project/css/login.css?verno=" + svnNum;
	
	//处理单点登录
	String iscas = "0";
	String json = PmLoginUtil.loginData(request);
	if (json.length() > 0) {
		iscas = "1";
	} else {
		response.sendRedirect(contextpath+"/index.jsp");
	}
	
	String assignJs = "";
	String assignId = request.getParameter("assign_id");
	if (assignId != null && assignId.length() > 0) {
		assignJs = PmLoginUtil.queryAssign(assignId);
	}
%>
<html>
<head>
	<title id='product_name'><%=indexName%>-<%=verType%>-<%=verNo%></title>
	<link rel="stylesheet" type="text/css" href="<%=loginCss%>" />
</head>
<body scroll="no">
	<div id="loading" class="login_loading">
		<img src="resources/images/jxstar32.gif" width="32" height="32"
		style="margin-right:8px;float:left;vertical-align:bottom;"/>
		<span id="loading-msg">正在加载样式文件...</span>
	</div>
	<iframe id="frmhidden" style="display:none;"></iframe>
	<link rel="stylesheet" type="text/css" href="public/lib/ext/resources/css/ext-all.css?verno=<%=svnNum%>" />
	<link rel="stylesheet" type="text/css" href="resources/css/main.css?verno=<%=svnNum%>" />
	<link rel="stylesheet" type="text/css" href="public/lib/ext/ux/css/portal.css?verno=<%=svnNum%>" />
	<link rel="stylesheet" type="text/css" href="public/lib/ext/ux/css/RowEditor.css?verno=<%=svnNum%>" />
	<link rel="stylesheet" type="text/css" href="public/lib/ext/ux/css/fileuploadfield.css?verno=<%=svnNum%>" />
	<link rel="stylesheet" type="text/css" href="public/lib/ext/ux/css/data-view.css?verno=<%=svnNum%>" />
	
	<script type="text/javascript">
		document.getElementById('loading-msg').innerHTML = '正在加载系统文件...';
	</script>

	<script type="text/javascript" src="public/lib/ext/adapter/ext-base.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ext-all.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/locale/ext-lang-<%=curLangType%>.js?verno=<%=svnNum%>"></script>
	
	<script type="text/javascript" src="public/lib/ext/ux/RowExpander.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/Portal.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/PortalColumn.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/Portlet.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/RowEditor.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/Emptybox.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/FileUploadField.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/ext/ux/JxPagerTool.js?verno=<%=svnNum%>"></script>
	
	<script type="text/javascript" src="public/locale/jxstar-lang-<%=curLangType%>.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxLang.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/SessionTimer.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/GridNode.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/FormNode.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxUtil.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxAttach.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxDefault.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxLists.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxGroup.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxSum.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxQuery.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxExport.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxPrint.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxHint.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxSelect.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxFormSub.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxQueryExt.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxGroupExt.js?verno=<%=svnNum%>"></script>
	
	<script type="text/javascript" src="public/portlet/PortletFun.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/portlet/PortletMsg.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/portlet/PortletWarn.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/portlet/PortletBoard.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/portlet/PortletResult.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/portlet/PortletResultG.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/portlet/PortletAssign.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxMenu.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/JxPortal.js?verno=<%=svnNum%>"></script>

	<script type="text/javascript" src="public/core/Request.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/XmlRequest.js?verno=<%=svnNum%>"></script>

	<script type="text/javascript" src="public/core/GridEvent.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/FormEvent.js?verno=<%=svnNum%>"></script>

	<script type="text/javascript" src="public/core/JxExt.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/core/Jxstar.js?verno=<%=svnNum%>"></script>
	
	<script type="text/javascript" src="project/JxPm.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript" src="public/lib/graph/js/mxCanvas.js?verno=<%=svnNum%>"></script>
	<script type="text/javascript">Ext.fly('loading').hide();</script>
</body>
<script language="javascript">
var assJs = "<%=assignJs%>";
Jxstar.iscas = '<%=iscas%>';
Jxstar.assignJs = null;//保存当前打开的审批任务消息
if (assJs.length > 0) {
	Jxstar.assignJs = Ext.decode(assJs);
}
//-------------------------------------------

Jxstar.path = '<%=contextpath%>';
Jxstar.systemVar.indexType = '<%=indexType%>';
Jxstar.systemVar.verType = '<%=verType%>';
Jxstar.systemVar.useCase = '<%=useCase%>';

Ext.BLANK_IMAGE_URL = Jxstar.path + '/public/lib/ext/resources/images/default/s.gif';
Ext.chart.Chart.CHART_URL = Jxstar.path + '/public/lib/ext/resources/charts.swf';

down_firfox = function() {
	var params = 'funid=sys_attach&keyid=jxstar0001&pagetype=editgrid&eventcode=down&nousercheck=1';
	Request.fileDown(params);
};

Ext.onReady(function() {
	//登陆成功
	var f_success = function(data) {
		Jxstar.session = data;
		Jxstar.session.maxInterval = <%=session.getMaxInactiveInterval()%>;
		Jxstar.session.sessionId = '<%=session.getId()%>';
		Request.loadJS('/public/core/JxBody.js');
	};
	
	//添加frmhidden的响应事件，用于处理文件下载的错误消息
	Ext.fly('frmhidden').on('load', function(event, dom){
		var text = dom.contentWindow.document.body.innerHTML;
		if (text == null || text.length == 0) {
			text = jx.index.downerror;
		}
		JxHint.alert(text);
	});
	
	//集成直接登录
	if (Jxstar.iscas == '1') {
		var json = Ext.decode("<%=json%>");
		if (!Ext.isEmpty(json)) {
			f_success(json);
		}
	}
});
</script>
</html>
